package router

import (
	"github.com/gin-gonic/gin"
	"shop/api/handler"
	"shop/api/middleware"
)

func Load(r *gin.Engine) {
	//r.Use(middleware.JWTAuth())
	r.Use(middleware.Cors())
	user := r.Group("/user")
	{
		user.POST("sendSms", handler.SendSms)
		user.GET("register", handler.Register)
		user.POST("login", handler.Login)
		user.POST("find", handler.FindMe)
		user.POST("createAddress", handler.Address)
		user.POST("coll", handler.Coll)
	}

	goods := r.Group("/shop")
	{
		goods.POST("add", handler.CreateSeckillGoods)
		goods.POST("find", handler.FindGoods)
		goods.POST("createOrder", handler.CreateOrder)
		goods.POST("pay", handler.Pay)
		goods.POST("shopCar", handler.AddShopCar)
	}
}
